package com.example.demo.config;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;

/**
 * 让ConfigurationProperties自动配置类生效的两种方式
 * 1、添加@Component、@Service、@Configuration
 * 2、使用@EnableConfigurationProperties
 */
//@Component
@ConfigurationProperties(
        prefix = "service.properties"
)
public class HelloServiceProperties {
    /**
     * 名字
     */
    private String name="HelloServiceProperties";

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
}
